home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / games / spassion / source.lzh / SOURCE / ENTRY.C < prev    next >
Text File  |  2000-03-25  |  2KB  |  121 lines

  1. /*
  2.     #include <stdio.h>
  3.     #include <stdlib.h>
  4.     #include <iocslib.h>
  5.     void    key_wait( void );
  6. */
  7.  
  8. #include <XSP2lib.H>
  9. #include "SPASSION.H"
  10. #include "ENEMY.H"
  11. #include "ENTRY.H"
  12. #include "SOUND.H"
  13.  
  14. #define ENTRY_MUSIC    250
  15. #define ENTRY_MUSIC_FADEOUT    251
  16. #define ENTRY_NON    253
  17. #define ENTRY_START    254
  18. #define ENTRY_END    255
  19. void    InitStage( void );
  20. void    EndStage( void );
  21.  
  22. enum {
  23.     WAIT_NON = 0, WAIT_NOW, WAIT_END
  24. };
  25.  
  26.  
  27. void Init0Entry( void )
  28. {
  29. }
  30.  
  31.  
  32.  
  33. /* ゲーム開始時に呼ばれる */
  34. void InitEntry( void )
  35. {
  36.     entry_counter = 0;
  37.     entry_timer = 0;
  38.     entry_counter_stop = 0;
  39. }
  40.  
  41.  
  42. void MoveEntry( void )
  43. {
  44.     void    VdispRoutine( void );
  45.  
  46.     if (entry_counter_stop)
  47.         return;        /* エントリーカウンター停止中 */
  48.     if (--entry_timer > 0)
  49.         return;        /* まだ敵は出現しない */
  50.  
  51. #ifdef DEBUG
  52.     {
  53. /*        char temp_str[64];
  54.         sprintf (temp_str, "ENTRY %03d", entry_counter);
  55.         TxfontCursor (22, 5);
  56.         TxfontPuts (temp_str);
  57. */    }
  58. #endif
  59.  
  60.     do{
  61.         short type = stage_data[stage][entry_counter].type;
  62.         entry_timer = stage_data[stage][entry_counter].timer;
  63.  
  64.         switch (type) {
  65.         case ENTRY_START:
  66. /*            GvramInit ();*/
  67.             InitStage();
  68. /*            bg_contrast_num = 33;*/
  69.             entry_counter++;
  70.             break;
  71.  
  72.         case ENTRY_END:
  73.             /* ここで停止されたエントリーカウンターは otoko.c VdispRoutine() で */
  74.             /* フェードアウトが終わると再開される */
  75.             entry_counter_stop = !0;    /* エントリーカウンター停止 */
  76. /*            bg_contrast_control = BG_FADEOUT;*/
  77.             game_state=END_STAGE;
  78.             xsp_vsyncint_on(&VdispRoutine);
  79. /*            bg_contrast_num = 33;*/
  80.             if (stage < STAGES - 1) {
  81.                 entry_counter = 0;
  82.                 entry_timer = 1;
  83.             } else {
  84.                 entry_counter++;
  85.                 entry_timer = 1;
  86.             }
  87.             break;
  88.  
  89.         case ENTRY_NON:
  90.             entry_counter++;
  91.             break;
  92.  
  93.         case ENTRY_MUSIC:
  94.             if( game_state==IN_GAME )
  95.                 PlayBGM(stage_data[stage][entry_counter].arg);
  96.             entry_counter++;
  97.             break;
  98.  
  99.         case ENTRY_MUSIC_FADEOUT:
  100.             FadeOut(stage_data[stage][entry_counter].arg);
  101.             entry_counter++;
  102.             break;
  103.  
  104.         default:
  105.             if( level >= stage_data[stage][entry_counter].control ){
  106.                 MakeEnemy(type,
  107.                        stage_data[stage][entry_counter].x, stage_data[stage][entry_counter].y,
  108.                    stage_data[stage][entry_counter].arg, (struct ENEMY *) 0);
  109.             }
  110.             entry_counter++;
  111.             break;
  112.         }
  113.     }while(entry_timer == 0);
  114. }
  115.  
  116.  
  117.  
  118. void TiniEntry( void )
  119. {
  120. }
  121.